<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">

    <title>登录-高校评优评奖管理系统</title>
    <meta name="keywords" content="高校评优评奖管理系统">
    <meta name="description" content="高校评优评奖管理系统">
    <link href="../../static/css/bootstrap.min.css" th:href="@{/css/bootstrap.min.css}" rel="stylesheet"/>
    <link href="../../static/css/font-awesome.min.css" th:href="@{/css/font-awesome.min.css}" rel="stylesheet"/>
    <link href="../../static/css/style.css" th:href="@{/css/style.css}" rel="stylesheet"/>
    <link href="../../static/css/login.min.css" th:href="@{/css/login.min.css}" rel="stylesheet"/>
    <link href="../../static/eams/css/dimple-ui.css" th:href="@{/eams/css/dimple-ui.css}" rel="stylesheet"/>
    <!--[if lt IE 9]>
    <meta http-equiv="refresh" content="0;ie.html"/>
    <![endif]-->
    <link rel="shortcut icon" href="../../static/favicon.ico" th:href="@{favicon.ico}"/>
    <style type="text/css">label.error {
        position: inherit;
    }</style>
    <script>
        if (window.top !== window.self) {
            window.top.location = window.location
        }
        ;
    </script>
</head>
<body class="signin">
<div class="signinpanel">
    <div class="row">
        <div class="col-sm-7">
            <div class="signin-info">
                <div class="logopanel m-b">
                    <h1><img alt="[ EAMS后台申请登录 ]" src="/static/favicon.ico" th:src="@{/favicon.ico}"></h1>
                </div>
                <div class="m-b"></div>
                <h4>欢迎使用 <strong>高校评优评奖 在线申请系统</strong></h4>
                <ul class="m-b">
                    <li><i class="fa fa-arrow-circle-o-right m-r-xs"></i> 此处仅供学生在线申请登录，管理员登录请点击<a href="/login">此处</a>
                    </li>
                    <li><i class="fa fa-arrow-circle-o-right m-r-xs"></i> 系统开放时间有限，请在规定的时间内进行填写</li>
                    <li><i class="fa fa-arrow-circle-o-right m-r-xs"></i> 如遇到任何问题，请联系bianxiaofeng@sohu.com</li>
                    <li><i class="fa fa-arrow-circle-o-right m-r-xs"></i> 默认登陆账号为学号，密码为身份者后六位。请登录系统后尽快修改密码</li>
                </ul>
                <strong>无法登陆？ <a href="#">请联系管理员添加学生信息&raquo;</a></strong>
            </div>
        </div>
        <div class="col-sm-5">
            <form id="signupForm">
                <h4 class="no-margins">登录：</h4>
                <input type="text" name="username" class="form-control uname" placeholder="学号" value=""/>
                <input type="password" name="password" class="form-control pword" placeholder="身份证后六位" value=""/>
                <button class="btn btn-success btn-block" id="btnSubmit" data-loading="正在验证登录，请稍后...">登录</button>
            </form>
        </div>
    </div>
    <div class="signup-footer">
        <div class="pull-left">
            &copy; 2019 All Rights Reserved. Dimple <br>
            <a href="http://www.miitbeian.gov.cn/" target="_blank" rel="nofollow">蜀ICP备 19004343</a><br>
        </div>
    </div>
</div>
<!-- 全局js -->
<script src="../../static/js/jquery.min.js" th:src="@{/js/jquery.min.js}"></script>
<script src="../../static/js/bootstrap.min.js" th:src="@{/js/bootstrap.min.js}"></script>
<!-- 验证插件 -->
<script src="../../static/ajax/libs/validate/jquery.validate.min.js"
        th:src="@{/ajax/libs/validate/jquery.validate.min.js}"></script>
<script src="../../static/ajax/libs/validate/messages_zh.min.js"
        th:src="@{/ajax/libs/validate/messages_zh.min.js}"></script>
<script src="../../static/ajax/libs/layer/layer.min.js" th:src="@{/ajax/libs/layer/layer.min.js}"></script>
<script src="../../static/ajax/libs/blockUI/jquery.blockUI.js"
        th:src="@{/ajax/libs/blockUI/jquery.blockUI.js}"></script>
<script src="../../static/eams/js/dimple-ui.js" th:src="@{/eams/js/dimple-ui.js}"></script>
<script>

    $(function () {
        validateRule();

    })
    $.validator.setDefaults({
        submitHandler: function () {
            login();
        }
    });

    function login() {
        $.modal.loading($("#btnSubmit").data("loading"));
        var username = $.common.trim($("input[name='username']").val());
        var password = $.common.trim($("input[name='password']").val());
        $.ajax({
            type: "post",
            url: "/f/login",
            data: {
                "username": username,
                "password": password,
            },
            success: function (r) {
                if (r.code == 0) {
                    location.href = '/f/apply/rule/';
                } else {
                    $.modal.closeLoading();
                    $.modal.msg(r.msg);
                }
            }
        });
    }

    function validateRule() {
        var icon = "<i class='fa fa-times-circle'></i> ";
        $("#signupForm").validate({
            rules: {
                username: {
                    required: true
                },
                password: {
                    required: true
                }
            },
            messages: {
                username: {
                    required: icon + "请输入您的学号",
                },
                password: {
                    required: icon + "请输入您的身份证后六位",
                }
            }
        })
    }

</script>
</body>
</html>
